package com.yifeng.repo.controller.excel.loader.dto;

/**
 * 数据任务类型枚举
 * Created by daibing on 2022/12/29.
 */
public enum DataTaskTypeEnum {
    EXPORT,
    IMPORT,
    ;

    public static DataTaskTypeEnum get(String raw) {
        try {
            return DataTaskTypeEnum.valueOf(raw.toUpperCase());
        } catch (Exception e) {
            return null;
        }
    }

    public String getDesc() {
        switch (this) {
            case EXPORT:
                return "导出";
            case IMPORT:
                return "导入";
            default:
                return "无效数据任务类型: " + this;
        }
    }
}
